package com.freemodbus4j.network.channel;

import com.freemodbus4j.network.handler.TcpMessageCodec;
import com.freemodbus4j.network.handler.TcpMessageHandler;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ModbusTcpChannelInitializer extends ModbusChannelInitializer{

    public ModbusTcpChannelInitializer(SimpleChannelInboundHandler handler) {
        super(handler);
    }

    protected void initPipelinePreProcessHandler(ChannelPipeline pipeline) {
        log.info("initPipelinePreProcessHandler={}",1);

        pipeline.addLast(new TcpMessageCodec());
        pipeline.addLast(new TcpMessageHandler());
    }



    protected void initPipelinePostProcessHandler(ChannelPipeline pipeline) {
        log.info("initPipelinePostProcessHandler={}",1);

    }

}
